/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package agents;

import env.Action;
import java.util.Scanner;
import javax.swing.ImageIcon;

/**
 *
 * @author orcas
 */
public class HumanAgentConsole extends AbsAgent {

    public HumanAgentConsole(String name, int row, int col) {
        super(name, row, col);
        super.setIcon(new ImageIcon("images/nolve.png"));
    }

    @Override
    public Action getMove() {
        System.out.println(this + ": please enter W/A/S/D/X");
        Scanner sc = new Scanner(System.in);
        switch (sc.next().toLowerCase().charAt(0)) {
            case 'w':
                return Action.up;
            case 'a':
                return Action.left;
            case 's':
                return Action.down;
            case 'd':
                return Action.right;
            case 'x':
                return Action.shoot;
            case 'q':
                System.exit(0);
        }
        return null;

    }
}
